package io;

import java.io.File;

/*
 * 文件分隔符
 * 构建file
 */
public class Demo1 {

	public static void main(String[] args) {
        //路径分隔符
		System.out.println(File.pathSeparator);
		//文件分隔符
		System.out.println(File.separator);
		
		//一般路劲的表示形式
		String path = "F:\\pic\\3.jpg";
		//可以做到跨平台使用
		path = "F:"+File.separator+"pic"+File.separator+"3.jpg";
	    //推荐使用这种
		path = "F:/pic/3.jpg";
		
		
		//绝对路径构建
		File file = new File(path);
		//相对路径构建
		String parentPath = "F:/pic";
		String name = "3.jpg";
		file = new File(parentPath,name);
		file = new File(new File(parentPath),name);
	}

}
